home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-11 | 33.7 KB | 1,150 lines |
- diff -c2 228src/AcornMake ../distsrc/src/AcornMake
- *** 228src/AcornMake Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/AcornMake Sun Mar 7 16:00:00 1993
- ***************
- *** 1,7 ****
- ! # Project: Gofer
-
-
- # Toolflags:
- ! CCflags = -c -depend !Depend -IC: -throwback -fac
- Linkflags = -aif -o $@
- ObjAsmflags = -depend !Depend -ThrowBack -Stamp -quit -CloseExec
- --- 1,7 ----
- ! # Project: Gofer228
-
-
- # Toolflags:
- ! CCflags = -c -depend !Depend -IC: -throwback -DLAMBDAVAR
- Linkflags = -aif -o $@
- ObjAsmflags = -depend !Depend -ThrowBack -Stamp -quit -CloseExec
- ***************
- *** 10,14 ****
- Squeezeflags = -o $@
- AAsmflags = -depend !Depend -quit -CloseExec -To $@ -From
- - PCflags = -c -depend !Depend -throwback -IP:
-
-
- --- 10,13 ----
- ***************
- *** 26,30 ****
- # User-editable dependencies:
-
- -
- # Static dependencies:
- @.o.compiler: @.c.compiler
- --- 25,28 ----
- ***************
- *** 66,69 ****
- --- 64,74 ----
- o.compiler: h.storage
- o.compiler: h.connect
- + o.input: c.input
- + o.input: h.prelude
- + o.input: h.storage
- + o.input: h.connect
- + o.input: h.command
- + o.input: h.errors
- + o.input: c.parser
- o.static: c.static
- o.static: h.prelude
- ***************
- *** 98,101 ****
- --- 103,117 ----
- o.cmachine: h.connect
- o.cmachine: h.errors
- + o.gofc: c.gofc
- + o.gofc: h.prelude
- + o.gofc: h.storage
- + o.gofc: h.command
- + o.gofc: h.connect
- + o.gofc: h.errors
- + o.gofc: c.machdep
- + o.gofc: C:h.swis
- + o.gofc: C:h.os
- + o.gofc: c.commonui
- + o.gofc: c.output
- o.builtin: c.builtin
- o.builtin: h.prelude
- ***************
- *** 124,143 ****
- o.output: h.connect
- o.output: h.errors
- - o.input: c.input
- - o.input: h.prelude
- - o.input: h.storage
- - o.input: h.connect
- - o.input: h.command
- - o.input: h.errors
- - o.input: c.parser
- - o.gofc: c.gofc
- - o.gofc: h.prelude
- - o.gofc: h.storage
- - o.gofc: h.command
- - o.gofc: h.connect
- - o.gofc: h.errors
- - o.gofc: c.machdep
- - o.gofc: C:h.swis
- - o.gofc: C:h.os
- - o.gofc: c.commonui
- - o.gofc: c.output
- --- 140,141 ----
- diff -c2 228src/Makefile ../distsrc/src/Makefile
- *** 228src/Makefile Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/Makefile Sun Mar 7 16:00:00 1993
- ***************
- *** 1,12 ****
- .SUFFIXES : .y .c .h .o .gs
- - HFILES = prelude.h storage.h connect.h errors.h command.h
- - CFILES = gofer.c storage.c input.c static.c type.c \
- - output.c compiler.c machine.c builtin.c \
- - gofc.c cmachine.c cbuiltin.c runtime.c
- - INCFILES = parser.c preds.c prims.c kind.c subst.c \
- - machdep.c commonui.c
- - GC_SRC = markscan.c twospace.c
- - YFILES = parser.y
- - SOURCES = $(HFILES) $(CFILES) $(INCFILES) $(YFILES) prelude
- OBJECTS = storage.o input.o static.o type.o compiler.o
- IOBJECTS = gofer.o builtin.o machine.o output.o $(OBJECTS)
- --- 1,3 ----
- ***************
- *** 29,36 ****
- # settings.
-
- ! CC = gcc
- CFLAGS =
- LDFLAGS = -lm
- OPTFLAGS = -O
-
- all : gofer gofc runtime.o
- --- 20,34 ----
- # settings.
-
- ! # IMPORTANT: make sure that you use the same compiler to build gofc
- ! # executables (often by setting an appropriate value in the gofcc script)
- ! # as you use to build the file runtime.o (as specified by the CC macro
- ! # below).
- !
- ! CC = cc
- CFLAGS =
- LDFLAGS = -lm
- OPTFLAGS = -O
- + OPT1 =
- + #OPT1 = -O1
-
- all : gofer gofc runtime.o
- ***************
- *** 75,86 ****
- gofc.o : prelude.h storage.h connect.h errors.h \
- command.h machdep.c commonui.c output.c
- ! runtime.o : prelude.h gofc.h machdep.c $(GC_SRC)
- storage.o : prelude.h storage.h connect.h errors.h
- input.o : prelude.h storage.h connect.h errors.h parser.c command.h
- ! static.o : prelude.h storage.h connect.h errors.h
- type.o : prelude.h storage.h connect.h errors.h preds.c kind.c subst.c
- output.o : prelude.h storage.h connect.h errors.h
- compiler.o : prelude.h storage.h connect.h errors.h
- ! $(CC) -c -O1 $(CFLAGS) compiler.c
- machine.o : prelude.h storage.h connect.h errors.h
- cmachine.o : prelude.h storage.h connect.h errors.h
- --- 73,84 ----
- gofc.o : prelude.h storage.h connect.h errors.h \
- command.h machdep.c commonui.c output.c
- ! runtime.o : prelude.h gofc.h machdep.c markscan.c twospace.c
- storage.o : prelude.h storage.h connect.h errors.h
- input.o : prelude.h storage.h connect.h errors.h parser.c command.h
- ! static.o : prelude.h storage.h connect.h errors.h scc.c
- type.o : prelude.h storage.h connect.h errors.h preds.c kind.c subst.c
- output.o : prelude.h storage.h connect.h errors.h
- compiler.o : prelude.h storage.h connect.h errors.h
- ! $(CC) -c $(OPT1) $(CFLAGS) compiler.c
- machine.o : prelude.h storage.h connect.h errors.h
- cmachine.o : prelude.h storage.h connect.h errors.h
- Only in ../distsrc/src: Makefile.ztc
- diff -c2 228src/Readme ../distsrc/src/Readme
- *** 228src/Readme Fri Feb 12 17:19:24 1993
- --- ../distsrc/src/Readme Sun Mar 7 16:00:00 1993
- ***************
- *** 21,24 ****
- --- 21,27 ----
-
- If appropriate, edit the Makefile as necessary to suit your system.
- + In particular, make sure that the CC macro is set to the name of
- + the compiler you will be using (this is usually either `cc' for the
- + standard C compiler on a system or `gcc' for the GNU C compiler).
-
- If you plan to install the Gofer compiler, edit the file cmachine.c
- ***************
- *** 25,30 ****
- so that the symbol GOFC_INCLUDE is set to a string containing the
- pathname $GOFLIB/gofc.h -- you will see that my two suggested settings
- ! are already set as defaults.
-
- Specific details for particular machine/configurations are given below.
-
- --- 28,37 ----
- so that the symbol GOFC_INCLUDE is set to a string containing the
- pathname $GOFLIB/gofc.h -- you will see that my two suggested settings
- ! are already set as defaults. Remember that double quote characters (")
- ! and backslashes (\) must be escaped by a leading backslash. For example:
-
- + "\"/usr/local/lib/Gofer/gofc.h\"" might be used on Unix machine,
- + "\"\C:\\GOFER\\GOFC\\GOFC.H\"" might be approp. for a DOS machine.
- +
- Specific details for particular machine/configurations are given below.
-
- ***************
- *** 45,49 ****
- $GOFLIB and edit the file gofc.h, replacing #include "prelude.h"
- with something like #include "$GOFLIB/prelude.h" -- don't actually
- ! enter the string "$GOFLIB/prelude" here, you're meant to replace
- $GOFLIB by whatever directory name you chose at the beginning of
- this process. You will also need to copy the file runtime.o (or
- --- 52,56 ----
- $GOFLIB and edit the file gofc.h, replacing #include "prelude.h"
- with something like #include "$GOFLIB/prelude.h" -- don't actually
- ! enter the string "$GOFLIB/prelude.h" here, you're meant to replace
- $GOFLIB by whatever directory name you chose at the beginning of
- this process. You will also need to copy the file runtime.o (or
- ***************
- *** 56,61 ****
- clean off any remaining object code files too ...
-
- I've probably left something out here. Please let me know if you have
- ! any trouble or spot anything that I've left out.
-
-
- --- 63,78 ----
- clean off any remaining object code files too ...
-
- + IMPORTANT: If you plan to use the shell scripts provided to operate
- + the Gofer compiler and you have a choice of C compilers on your
- + system (e.g. GNU gcc and a vendor-supplied cc) make sure that the C
- + compiler mentioned in the script gofcc is the same C compiler used
- + (in the Makefile) to compile runtime.c. In a similar way, make sure
- + that the version of gofc.h used to compile runtime.c has the same
- + settings as the version of gofc.h that you put in $GOFLIB. (This is
- + only likely to be relevant if you install an alternative garbage
- + collector or change the setting on ARGCHECK.)
- +
- I've probably left something out here. Please let me know if you have
- ! any trouble or spot anything that you think I should have mentioned!
-
-
- ***************
- *** 145,148 ****
- --- 162,172 ----
-
- ---------------------
- + Zortech C++ v3.0 for IBM PC (>=386)
- +
- + Set #define ZTC 1 and the rest to 0 in prelude.h. Compile using the
- + makefile supplied as Makefile.ztc. Thanks to John Lazenby for the patches
- + to get this to work!
- +
- + ---------------------
- DJGPP 1.09 on MSDOS:
-
- ***************
- *** 201,207 ****
- IBM OS/2 2.0 using EMX GCC:
-
- ! Set #define OS2 1 and the rest to 0 in prelude.h. The tweaks to prelude.h
- ! to get this working with OS/2 were sent to me by Bryan Scattergood this
- ! morning; this is a last-minute update. Thanks Bryan!
-
-
- --- 225,230 ----
- IBM OS/2 2.0 using EMX GCC:
-
- ! Set #define OS2 1 and the rest to 0 in prelude.h. Thanks to
- ! Bryan Scattergood for sending the patches to get this working!
-
-
- ***************
- *** 209,218 ****
- System V release 4 using GCC2.2:
-
- ! Set #define SVR4 1 and the rest to 0 in prelude.h. As in the case of OS/2,
- ! I received patches for SVR4 this morning from Bryan Scattergood. Thanks
- ! again Bryan!
-
-
- ---------------------
- HP systems:
-
- --- 232,259 ----
- System V release 4 using GCC2.2:
-
- ! Set #define SVR4 1 and the rest to 0 in prelude.h. Thanks to
- ! Bryan Scattergood for sending the patches to get this working!
-
-
- ---------------------
- + SCO Unix 3.2.4:
- +
- + Set #define SVR4 1 and the rest to 0 in prelude.h. Compile using gcc 2.2.2.
- + Thanks to Rodney Brown!
- +
- +
- + ---------------------
- + Silicon Graphics with Irix:
- +
- + Set #define SVR4 1 and the rest to 0 in prelude.h. Set the makefile to
- + use cc. If you are running on a machine with a MIPS R4000 CPU, you might
- + also like to add -mips2 to CFLAGS (this should not be used if you want
- + backward compatibility with machines based on the MIPS R3000 CPU).
- +
- + I think you can probably build Gofer using gcc but I haven't had the
- + opportunity to try that myself.
- +
- +
- + ---------------------
- HP systems:
-
- ***************
- *** 227,235 ****
- the patches everyone!
-
- ! It has now been verified that the HPUX patch version will at least compile
- ! correctly on HP series 400 workstations (68040 CPU) running HP-UX 8.0 with
- ! gcc, thanks to Kurt Olender!
-
-
- ---------------------
- DECstation 5000 running Ultrix 4.2 (MIPS R3000 CPU) with GCC2.3.3:
- --- 268,289 ----
- the patches everyone!
-
- ! It has now been verified that the HPUX patch version will at least
- ! compile correctly on HP series 400 workstations (68040 CPU) running
- ! HP-UX 8.0 with gcc, thanks to Kurt Olender!
-
- + Gofer 2.28 has also been built on an H.P. Series 700 machine running
- + HP-UX 8.07. Gofer does not work if it is compiled using gcc (2.3.3).
- + Use the HP C compiler (cc) in ANSI mode. A guide to setting the
- + macro definitions in the Makefile:
-
- + CC = cc
- + CFLAGS = -Aa -D_HPUX_SOURCE
- + LDFLAGS = -lm
- + OPTFLAGS = +O3
- + OPT1 = +O1
- +
- + Thanks to Dave Sherratt for this information!
- +
- +
- ---------------------
- DECstation 5000 running Ultrix 4.2 (MIPS R3000 CPU) with GCC2.3.3:
- ***************
- *** 238,242 ****
- --- 292,300 ----
- for the patches!
-
- + This release of Gofer includes a slight modification, brought to my notice
- + by Jerry Prothero, which should also make it possible to compile Gofer using
- + DEC's own cc compiler instead of gcc. Thanks Jerry!
-
- +
- ---------------------
- IBM AIX on RS/6000 using GCC:
- ***************
- *** 266,269 ****
- --- 324,339 ----
- may be needed -- please let me know if you try it. And thanks, Ray!
-
- + Since 2.28 was first distributed I've had feedback from two people
- + that have compiled Gofer to run on Linux. Bambang Prastowo wrote
- + to let me know that Gofer compiled without modifications (other
- + than setting #define LINUX 1). Eak Khoon reported that it was
- + neccessary to comment out the #define const at the beginning of
- + prelude.h and change prototypes in prelude.h to:
- + extern *getenv Args((const char *));
- + extern system Args((const char *));
- + extern atof Args((const char *));
- + This may be due to the use of slightly different compilers or versions
- + of Linux. In any case, it should be fairly straightforward to build
- + Gofer to run under Linux.
-
- ---------------------
- ***************
- *** 283,287 ****
- do not currently work. I believe this can be solved by setting an
- appropriate value for the #define allowBreak() macro in prelude.h,
- ! but I am not sure what definition should be used.
-
-
- --- 353,366 ----
- do not currently work. I believe this can be solved by setting an
- appropriate value for the #define allowBreak() macro in prelude.h,
- ! but I am not sure what definition should be used. Frederek Althoff
- ! has investigated this problem and believes that there may be a problem
- ! with the signal handling in the current version of gcc on the Amiga.
- ! Frederek has written a C program, included in the main distribution
- ! as amigaint.c, to try and help out. In his words: `` All you have
- ! to do is start the program from an other shell with the process-id
- ! of gofer. To get this id, you have to use a program called "Status"
- ! (similar to "ps"). That's all. You might add this program to your
- ! distribution? This will `help' until the ^C-problem is fixed''.
- ! Thanks Frederek!
-
-
- Only in ../distsrc/src: amigaint.c
- diff -c2 228src/cmachine.c ../distsrc/src/cmachine.c
- *** 228src/cmachine.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/cmachine.c Sun Mar 7 16:00:00 1993
- ***************
- *** 20,26 ****
- --- 20,30 ----
- #define GOFC_INCLUDE "\"/gofer/gofc/gofc.h\""
- #else
- + #if RISCOS
- + #define GOFC_INCLUDE "\"Lib:h.gofc\""
- + #else
- #define GOFC_INCLUDE "\"/usr/local/lib/Gofer/gofc.h\""
- #endif
- #endif
- + #endif
-
- /*#define DEBUG_CODE*/
- ***************
- *** 575,580 ****
- make(fst(snd(e)),co,l1,fbranch(mkInt(l2),d));
- asLABEL(l1);
- ! srsp = savesp;
- ! asSETSTK(srsp);
- make(snd(snd(e)),co,f,frunon(d));
- asLABEL(l2);
- --- 579,583 ----
- make(fst(snd(e)),co,l1,fbranch(mkInt(l2),d));
- asLABEL(l1);
- ! asSETSTK(savesp);
- make(snd(snd(e)),co,f,frunon(d));
- asLABEL(l2);
- ***************
- *** 586,591 ****
- make(fst(snd(e)),co,l,d1);
- asLABEL(l);
- ! srsp = savesp;
- ! asSETSTK(srsp);
- make(snd(snd(e)),co,f,d1);
- }
- --- 589,593 ----
- make(fst(snd(e)),co,l,d1);
- asLABEL(l);
- ! asSETSTK(savesp);
- make(snd(snd(e)),co,f,d1);
- }
- ***************
- *** 682,686 ****
- make(t,co,f,fbranch(mkInt(l2),d));
- asLABEL(l1);
- ! srsp = savesp;
- make(e,co,f,frunon(d));
- asLABEL(l2);
- --- 684,689 ----
- make(t,co,f,fbranch(mkInt(l2),d));
- asLABEL(l1);
- ! if (srsp!=savesp)
- ! asSETSTK(savesp);
- make(e,co,f,frunon(d));
- asLABEL(l2);
- ***************
- *** 690,694 ****
- make(t,co,f,d1);
- asLABEL(l1);
- ! srsp = savesp;
- make(e,co,f,d1);
- }
- --- 693,698 ----
- make(t,co,f,d1);
- asLABEL(l1);
- ! if (srsp!=savesp)
- ! asSETSTK(savesp);
- make(e,co,f,d1);
- }
- ***************
- *** 1622,1626 ****
- break;
-
- ! case FLOATCELL : fprintf(fp,"pushFloat(%g)",floatOf(instr));
- break;
-
- --- 1626,1631 ----
- break;
-
- ! case FLOATCELL : fprintf(fp,"pushFloat(%s)",
- ! floatToString(floatOf(instr)));
- break;
-
- diff -c2 228src/commonui.c ../distsrc/src/commonui.c
- *** 228src/commonui.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/commonui.c Sun Mar 7 16:00:00 1993
- ***************
- *** 149,153 ****
- if (heapSize<MINIMUMHEAP)
- heapSize = MINIMUMHEAP;
- ! #if MAXIMUMHEAP > 0
- else if (heapSize>MAXIMUMHEAP)
- heapSize = MAXIMUMHEAP;
- --- 149,153 ----
- if (heapSize<MINIMUMHEAP)
- heapSize = MINIMUMHEAP;
- ! #if MAXIMUMHEAP
- else if (heapSize>MAXIMUMHEAP)
- heapSize = MAXIMUMHEAP;
- diff -c2 228src/gofc.c ../distsrc/src/gofc.c
- *** 228src/gofc.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/gofc.c Sun Mar 7 16:00:00 1993
- ***************
- *** 25,29 ****
- #endif
-
- ! #define VERSION "1.01 (2.28)"
-
- Bool dumpScs = FALSE; /* TRUE => output sc defns */
- --- 25,29 ----
- #endif
-
- ! #define VERSION "1.01 (2.28a)"
-
- Bool dumpScs = FALSE; /* TRUE => output sc defns */
- ***************
- *** 155,159 ****
- strcpy(outputFile,s);
-
- - #if !RISCOS
- for (s=outputFile, dot=0; *s; ++s) /* do something sensible */
- if (*s=='.') /* with file extensions */
- --- 155,158 ----
- ***************
- *** 160,163 ****
- --- 159,163 ----
- dot = s;
-
- + #if !RISCOS
- if (dot && (strcmp(dot+1,"gp") == 0 || strcmp(dot+1,"prj") ==0 ||
- strcmp(dot+1,"hs") == 0 || strcmp(dot+1,"lhs") ==0 ||
- ***************
- *** 170,175 ****
- strcat(outputFile,suff);
- #else
- ! strcat(outputFile,suff);
- ! outputFile[strlen(outputFile)-strlen(suff)] = '_'; /* No dot */
- #endif
- }
- --- 170,197 ----
- strcat(outputFile,suff);
- #else
- ! if (dot) {
- ! char *prev = dot;
- ! while (prev>outputFile && *--prev!='.')
- ! ;
- ! if (*prev == '.')
- ! ++prev;
- ! if (namecmp(prev, "gp") || namecmp(prev, "hs")
- ! || namecmp(prev, "gs") || namecmp(prev, "gof")
- ! || namecmp(prev, "lit") || namecmp(prev, "prj")
- ! || namecmp(prev, "lhs") || namecmp(prev, "lgs")
- ! || namecmp(prev, "has") || namecmp(prev, "verb")
- ! || namecmp(prev, "prelude")) {
- ! strcpy(prev, suff+1);
- ! strcat(prev, dot);
- ! }
- ! else {
- ! strcat(outputFile,suff);
- ! outputFile[strlen(outputFile)-strlen(suff)] = '_'; /* No dot */
- ! }
- ! }
- ! else {
- ! strcat(outputFile,suff);
- ! outputFile[strlen(outputFile)-strlen(suff)] = '_'; /* No dot */
- ! }
- #endif
- }
- diff -c2 228src/gofc.h ../distsrc/src/gofc.h
- *** 228src/gofc.h Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/gofc.h Sun Mar 7 16:00:00 1993
- ***************
- *** 74,78 ****
- #else
- #define MAXBOXTAG FLOATCELL /* Last boxed cell tag */
- ! #define safeMkFloat(n) mkFloat(n)
- #endif
- #define MAXTAG FLOATCELL /* Last tag value */
- --- 74,78 ----
- #else
- #define MAXBOXTAG FLOATCELL /* Last boxed cell tag */
- ! #define safeMkFloat(n) mkFloat((FloatPro)n)
- #endif
- #define MAXTAG FLOATCELL /* Last tag value */
- ***************
- *** 108,112 ****
-
- #define mkChar(c) ((Cell)(SMALLMIN+((unsigned)((c)%NUM_CHARS))))
- ! #define charOf(c) ((char)((c)-SMALLMIN))
-
- #define mkDict(n) ((Cell)(SMALLMIN+(n)))
- --- 108,112 ----
-
- #define mkChar(c) ((Cell)(SMALLMIN+((unsigned)((c)%NUM_CHARS))))
- ! #define charOf(c) ((Char)((c)-SMALLMIN))
-
- #define mkDict(n) ((Cell)(SMALLMIN+(n)))
- diff -c2 228src/gofer.c ../distsrc/src/gofer.c
- *** 228src/gofer.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/gofer.c Sun Mar 7 16:00:00 1993
- ***************
- *** 78,82 ****
- /* hours of work involved by retaining my name in the banner. Thanks! */
-
- ! printf("Gofer Version 2.28 Copyright (c) Mark P Jones 1991-1993\n\n");
- fflush(stdout);
- interpreter(argc,argv);
- --- 78,82 ----
- /* hours of work involved by retaining my name in the banner. Thanks! */
-
- ! printf("Gofer Version 2.28a Copyright (c) Mark P Jones 1991-1993\n\n");
- fflush(stdout);
- interpreter(argc,argv);
- diff -c2 228src/input.c ../distsrc/src/input.c
- *** 228src/input.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/input.c Sun Mar 7 16:00:00 1993
- ***************
- *** 219,225 ****
- static Bool local literateMode(nm) /* selecte literate mode for file */
- String nm; {
- - #if !RISCOS
- String dot = 0;
-
- for (; *nm; ++nm) /* look for last dot in file name */
- if (*nm == '.')
- --- 219,225 ----
- static Bool local literateMode(nm) /* selecte literate mode for file */
- String nm; {
- String dot = 0;
-
- + #if !RISCOS
- for (; *nm; ++nm) /* look for last dot in file name */
- if (*nm == '.')
- ***************
- *** 240,243 ****
- --- 240,262 ----
- return TRUE;
- }
- + #else
- + char *start = nm;
- + for (; *nm; ++nm) /* look for last dot in file name */
- + if (*nm == '.')
- + dot = nm+1;
- + if (dot) {
- + char *prev = dot-1;
- + while (prev > start && *--prev != '.')
- + ;
- + if (*prev == '.')
- + ++prev;
- + if (namecmp(prev,"hs") || namecmp(prev,"gs")
- + || namecmp(prev,"gof") || namecmp(prev,"has")
- + || namecmp(prev,"prelude"))
- + return FALSE;
- + if (namecmp(prev,"lhs") || namecmp(prev,"lgs")
- + || namecmp(prev,"lit") || namecmp(prev,"verb"))
- + return TRUE;
- + }
- #endif
- return literateScripts; /* otherwise, use the default */
- ***************
- *** 371,375 ****
- saveTokenChar(c0);
- skip();
- ! } while (isascii(c0) && isoneof(c0,SYMBOLS));
- opType = (tokenStr[0]==':' ? CONOP : VAROP);
- endToken();
- --- 390,394 ----
- saveTokenChar(c0);
- skip();
- ! } while (c0!=EOF && isascii(c0) && isoneof(c0,SYMBOLS));
- opType = (tokenStr[0]==':' ? CONOP : VAROP);
- endToken();
- ***************
- *** 382,386 ****
- saveTokenChar(c0);
- skip();
- ! } while ((isascii(c0) && isalnum(c0)) || c0=='_' || c0=='\'');
- endToken();
- identType = isupper(tokenStr[0]) ? CONID : VARID;
- --- 401,405 ----
- saveTokenChar(c0);
- skip();
- ! } while ((c0!=EOF && isascii(c0) && isalnum(c0)) || c0=='_' || c0=='\'');
- endToken();
- identType = isupper(tokenStr[0]) ? CONID : VARID;
- ***************
- *** 399,403 ****
- saveTokenChar(c0);
- skip();
- ! } while (isascii(c0) && isdigit(c0));
-
- if (c0!='.' || !isascii(c1) || !isdigit(c1)) {
- --- 418,422 ----
- saveTokenChar(c0);
- skip();
- ! } while (c0!=EOF && isascii(c0) && isdigit(c0));
-
- if (c0!='.' || !isascii(c1) || !isdigit(c1)) {
- ***************
- *** 418,422 ****
- saveTokenChar(c0);
- skip();
- ! } while (isascii(c0) && isdigit(c0));
-
- if (c0=='e' || c0=='E') { /* look for exponent part... */
- --- 437,441 ----
- saveTokenChar(c0);
- skip();
- ! } while (c0!=EOF && isascii(c0) && isdigit(c0));
-
- if (c0=='e' || c0=='E') { /* look for exponent part... */
- ***************
- *** 438,442 ****
- saveTokenChar(c0);
- skip();
- ! } while (isascii(c0) && isdigit(c0));
- }
- }
- --- 457,461 ----
- saveTokenChar(c0);
- skip();
- ! } while (c0!=EOF && isascii(c0) && isdigit(c0));
- }
- }
- ***************
- *** 515,519 ****
- return readEscapeChar(allowEmpty);
- if (!isprint(c0)) {
- ! ERROR(row) "Non printable character in constant"
- EEND;
- }
- --- 534,538 ----
- return readEscapeChar(allowEmpty);
- if (!isprint(c0)) {
- ! ERROR(row) "Non printable character '\\%d' in constant", ((int)c0)
- EEND;
- }
- ***************
- *** 609,613 ****
- do /* (simplified in Haskell 1.1) */
- skip();
- ! while (c0==' ' || c0=='\t' || c0=='\n');
- if (c0!='\\') {
- ERROR(row) "Missing `\\' terminating string literal gap"
- --- 628,633 ----
- do /* (simplified in Haskell 1.1) */
- skip();
- ! while (c0==' ' || c0=='\t' || c0=='\n')
- ! ;
- if (c0!='\\') {
- ERROR(row) "Missing `\\' terminating string literal gap"
- ***************
- *** 698,702 ****
- n = 10*n + (c0-'0');
- skip();
- ! } while (isascii(c0) && isdigit(c0));
-
- return mkChar(n);
- --- 718,722 ----
- n = 10*n + (c0-'0');
- skip();
- ! } while (c0!=EOF && isascii(c0) && isdigit(c0));
-
- return mkChar(n);
- ***************
- *** 896,900 ****
- do
- skip();
- ! while (c0!='\n' && c0!=EOF);
- if (c0=='\n')
- newlineSkip();
- --- 916,921 ----
- do
- skip();
- ! while (c0!='\n' && c0!=EOF)
- ! ;
- if (c0=='\n')
- newlineSkip();
- ***************
- *** 1012,1016 ****
-
- if (!(isascii(c0) && isprint(c0))) {
- ! ERROR(row) "Unrecognised character in column %d", column
- EEND;
- }
- --- 1033,1038 ----
-
- if (!(isascii(c0) && isprint(c0))) {
- ! ERROR(row) "Unrecognised character '\\%d' in column %d",
- ! ((int)c0), column
- EEND;
- }
- ***************
- *** 1076,1080 ****
- }
-
- ! ERROR(row) "Unrecognised token in column %d", column
- EEND;
- return 0; /*NOTREACHED*/
- --- 1098,1102 ----
- }
-
- ! ERROR(row) "Unrecognised character '\\%d' in column %d", ((int)c0), column
- EEND;
- return 0; /*NOTREACHED*/
- diff -c2 228src/machdep.c ../distsrc/src/machdep.c
- *** 228src/machdep.c Fri Feb 12 17:07:08 1993
- --- ../distsrc/src/machdep.c Sun Mar 7 16:00:00 1993
- ***************
- *** 27,30 ****
- --- 27,38 ----
- #endif
-
- + #if ZTC
- + #include <stdlib.h>
- + #include <signal.h>
- + #include <fcntl.h>
- + #include <sys/types.h>
- + #include <sys/stat.h>
- + #endif
- +
- #if DJGPP
- #include <dos.h>
- ***************
- *** 118,121 ****
- --- 126,138 ----
- return r.r[0] != 1;
- }
- +
- + int namecmp(char *filename, char *spec){/* For filename extension hacks */
- + while(*spec)
- + if (tolower(*filename) != *spec++)
- + return 0;
- + else
- + ++filename;
- + return *filename == '.';
- + }
- #endif
-
- ***************
- *** 300,303 ****
- --- 317,324 ----
- Int getTerminalWidth() { /* determine width of terminal */
- #ifdef TIOCGWINSZ
- + #ifdef _M_UNIX /* SCO Unix 3.2.4 defines TIOCGWINSZ*/
- + #include <sys/stream.h> /* Required by sys/ptem.h */
- + #include <sys/ptem.h> /* Required to declare winsize */
- + #endif
- static struct winsize terminalSize;
- ioctl(fileno(stdout),TIOCGWINSZ,&terminalSize);
- ***************
- *** 501,505 ****
- Int i=0, j=0;
-
- ! sprintf(buffer1,"%g",fl);
- while (buffer1[i] && strchr("eE.",buffer1[i])==0)
- buffer2[j++] = buffer1[i++];
- --- 522,526 ----
- Int i=0, j=0;
-
- ! sprintf(buffer1,FloatFMT,fl);
- while (buffer1[i] && strchr("eE.",buffer1[i])==0)
- buffer2[j++] = buffer1[i++];
- diff -c2 228src/machine.c ../distsrc/src/machine.c
- *** 228src/machine.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/machine.c Sun Mar 7 16:00:00 1993
- ***************
- *** 448,452 ****
- return pc+3;
- #else
- ! printf("%s\t%s\n",s,floatToString(floatAt(pc+1)));
- return pc+2;
- #endif
- --- 448,452 ----
- return pc+3;
- #else
- ! printf("%s\t%s\n",s,floatToString((FloatPro)floatAt(pc+1)));
- return pc+2;
- #endif
- ***************
- *** 774,778 ****
- * Lambda lifting, in particular, is likely to introduce such functions.
- * Rather than reconstructing a new instance of the recursive function and
- ! * it's arguments, we can extract the relevant portion of the root of the
- * current redex.
- *
- --- 774,778 ----
- * Lambda lifting, in particular, is likely to introduce such functions.
- * Rather than reconstructing a new instance of the recursive function and
- ! * its arguments, we can extract the relevant portion of the root of the
- * current redex.
- *
- diff -c2 228src/preds.c ../distsrc/src/preds.c
- *** 228src/preds.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/preds.c Sun Mar 7 16:00:00 1993
- ***************
- *** 179,182 ****
- --- 179,183 ----
- Bool aft = instsCompare(in,hd(ins));
- if (bef==aft) {
- + class(cl).instances = revOnto(done,ins);
- ERROR(line) "Overlapping instances for class \"%s\"",
- textToStr(class(inst(in).cl).text)
- diff -c2 228src/prelude.h ../distsrc/src/prelude.h
- *** 228src/prelude.h Fri Feb 12 17:14:20 1993
- --- ../distsrc/src/prelude.h Sun Mar 7 16:00:00 1993
- ***************
- *** 33,36 ****
- --- 33,37 ----
- #define LINUX 0 /* For Linux using gcc UN */
- #define DJGPP 0 /* For DJGPP version 1.09 (gcc2.2.2) and DOS 5.0 */
- + #define ZTC 0 /* For IBM PC (>= 386) Zortech C++ v3.0 (-mx) */
- #define RISCOS 0 /* For Acorn DesktopC and RISCOS2 or 3 */
- #define ALPHA 0 /* For DEC Alpha with OSF/1 (32 bit ints, no gofc) */
- ***************
- *** 66,73 ****
- MINIX68K |ALPHA | OS2 | SVR4 | ULTRIX | AIX)
- #define SMALL_GOFER (TURBOC | BCC)
- ! #define REGULAR_GOFER (RISCOS | DJGPP)
- #define LARGE_GOFER (UNIX | ALPHA)
- ! #define JMPBUF_ARRAY (UNIX | DJGPP | RISCOS)
- ! #define DOS_IO (TURBOC | BCC | DJGPP)
- #define TERMIO_IO (LINUX | HPUX | OS2 | SVR4)
- #define SGTTY_IO (SUNOS | NEXTSTEP | NEXTGCC | AMIGA | MINIX68K | \
- --- 67,74 ----
- MINIX68K |ALPHA | OS2 | SVR4 | ULTRIX | AIX)
- #define SMALL_GOFER (TURBOC | BCC)
- ! #define REGULAR_GOFER (RISCOS | DJGPP | ZTC)
- #define LARGE_GOFER (UNIX | ALPHA)
- ! #define JMPBUF_ARRAY (UNIX | DJGPP | RISCOS | ZTC)
- ! #define DOS_IO (TURBOC | BCC | DJGPP | ZTC)
- #define TERMIO_IO (LINUX | HPUX | OS2 | SVR4)
- #define SGTTY_IO (SUNOS | NEXTSTEP | NEXTGCC | AMIGA | MINIX68K | \
- ***************
- *** 124,127 ****
- --- 125,130 ----
- * FOPEN_WRITE fopen *text* file for writing
- * FOPEN_APPEND fopen *text* file for append
- + *
- + * N.B. `far' must be explicitly defined (usually to the empty string)
- *-------------------------------------------------------------------------*/
-
- ***************
- *** 129,133 ****
- #define Args(x) x
- #else
- ! #if (TURBOC | BCC) /* K&R 1 does not permit `defined(__STDC__)' ... */
- #define Args(x) x
- #else
- --- 132,136 ----
- #define Args(x) x
- #else
- ! #if (TURBOC | BCC | ZTC) /* K&R 1 does not permit `defined(__STDC__)' ... */
- #define Args(x) x
- #else
- ***************
- *** 162,166 ****
- #endif
-
- ! #if (HPUX | DJGPP | LINUX | ALPHA | OS2 | SVR4 | AIX)
- #include <stdlib.h>
- #define far
- --- 165,169 ----
- #endif
-
- ! #if (HPUX | DJGPP | ZTC | LINUX | ALPHA | OS2 | SVR4 | AIX)
- #include <stdlib.h>
- #define far
- ***************
- *** 176,179 ****
- --- 179,183 ----
- #define MainDone return 0;/*NOTUSED*/
- extern int access Args((char *, int));
- + extern int namecmp Args((char *, char *));
- #endif
-
- ***************
- *** 209,213 ****
- #endif
-
- ! #if (UNIX | DJGPP | RISCOS)
- #define ctrlbrk(bh) signal(SIGINT,bh)
- #endif
- --- 213,217 ----
- #endif
-
- ! #if (UNIX | DJGPP | RISCOS | ZTC)
- #define ctrlbrk(bh) signal(SIGINT,bh)
- #endif
- ***************
- *** 227,230 ****
- --- 231,235 ----
- typedef unsigned Unsigned;
-
- + #ifndef STD_PRELUDE
- #if RISCOS
- #define STD_PRELUDE "prelude"
- ***************
- *** 232,235 ****
- --- 237,241 ----
- #define STD_PRELUDE "standard.prelude"
- #endif
- + #endif
-
- #define NUM_SYNTAX 100
- ***************
- *** 304,310 ****
- #endif
-
- ! #if (REGULAR_GOFER | MEDIUM_GOFER) & BREAK_FLOATS
- #define FloatImpType double
- #define FloatPro double
- #else
- #define FloatImpType float
- --- 310,317 ----
- #endif
-
- ! #if (REGULAR_GOFER | LARGE_GOFER) & BREAK_FLOATS
- #define FloatImpType double
- #define FloatPro double
- + #define FloatFMT "%.9g"
- #else
- #define FloatImpType float
- ***************
- *** 312,315 ****
- --- 319,323 ----
- /* strictly ansi (i.e. gcc) conforming */
- /* but breaks data hiding :-( */
- + #define FloatFMT "%g"
- #endif
- #else
- ***************
- *** 316,319 ****
- --- 324,328 ----
- #define FloatImpType int /*dummy*/
- #define FloatPro int
- + #define FloatFMT "%d"
- #endif
-
- diff -c2 228src/prims.c ../distsrc/src/prims.c
- *** 228src/prims.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/prims.c Sun Mar 7 16:00:00 1993
- ***************
- *** 908,914 ****
- break;
-
- ! case FLOATCELL: output = stringOutput(floatToString(whnfFloat),
- ! output);
- ! pr = nameNPrint;
- break;
-
- --- 908,917 ----
- break;
-
- ! case FLOATCELL: if (whnfFloat<0.0 && d>=FUN_PREC)
- ! output = ap(consOpen,output);
- ! output = stringOutput(floatToString(whnfFloat),output);
- ! if (whnfFloat<0.0 && d>=FUN_PREC)
- ! output = ap(consClose,output);
- ! pr = nameNPrint;
- break;
-
- diff -c2 228src/static.c ../distsrc/src/static.c
- *** 228src/static.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/static.c Sun Mar 7 16:00:00 1993
- ***************
- *** 394,400 ****
- Type t; { /* assuming that all relevant */
- Cell h = t; /* synonym defns of lower rank have*/
- ! for (; isAp(h); h=fun(h)) /* already been fully expanded */
- arg(h) = fullExpand(arg(h));
- ! if (isSynonym(h))
- t = instantiateSyn(tycon(h).defn,t);
- return t;
- --- 394,401 ----
- Type t; { /* assuming that all relevant */
- Cell h = t; /* synonym defns of lower rank have*/
- ! Int n = 0; /* already been fully expanded */
- ! for (; isAp(h); h=fun(h), n++)
- arg(h) = fullExpand(arg(h));
- ! if (isSynonym(h) && n==tycon(h).arity)
- t = instantiateSyn(tycon(h).defn,t);
- return t;
- diff -c2 228src/storage.c ../distsrc/src/storage.c
- *** 228src/storage.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/storage.c Sun Mar 7 16:00:00 1993
- ***************
- *** 264,272 ****
- Cell what;
- Cell defn; {
- ! Tycon tc = newTycon(findText(s));
- ! tycon(tc).line = 0;
- ! tycon(tc).kind = kind;
- ! tycon(tc).what = what;
- ! tycon(tc).defn = defn;
- return tc;
- }
- --- 264,275 ----
- Cell what;
- Cell defn; {
- ! Tycon tc = newTycon(findText(s));
- ! tycon(tc).line = 0;
- ! tycon(tc).kind = kind;
- ! tycon(tc).what = what;
- ! tycon(tc).defn = defn;
- ! tycon(tc).arity = 0;
- ! for (; isAp(kind); kind=snd(kind))
- ! ++tycon(tc).arity;
- return tc;
- }
- diff -c2 228src/type.c ../distsrc/src/type.c
- *** 228src/type.c Fri Feb 12 12:00:00 1993
- --- ../distsrc/src/type.c Sun Mar 7 16:00:00 1993
- ***************
- *** 4,8 ****
- * Gofer version 2.28 January 1993
- *
- ! * This is the gofer type checker: Based on the extended algorithm in my
- * PRG technical report PRG-TR-10-91, supporting the use of qualified types
- * in the form of multi-parameter type classes, according to my `new
- --- 4,8 ----
- * Gofer version 2.28 January 1993
- *
- ! * This is the Gofer type checker: Based on the extended algorithm in my
- * PRG technical report PRG-TR-10-91, supporting the use of qualified types
- * in the form of multi-parameter type classes, according to my `new
- ***************
- *** 508,511 ****
- --- 508,512 ----
- static String list = "list";
- static String discr = "case discriminant";
- + static String aspat = "as (@) pattern";
-
- switch (whatIs(e)) {
- ***************
- *** 623,628 ****
- break;
-
- ! case ASPAT : snd(snd(e)) = typeExpr(l,snd(snd(e)));
- ! bindTv(newVarsBind(fst(snd(e))),typeIs,typeOff);
- break;
-
- --- 624,633 ----
- break;
-
- ! case ASPAT : { Int beta = newTyvars(1);
- ! snd(snd(e)) = typeExpr(l,snd(snd(e)));
- ! bindTv(beta,typeIs,typeOff);
- ! check(l,fst(snd(e)),e,aspat,var,beta);
- ! tyvarType(beta);
- ! }
- break;
-
-